/* Per-CPU periodic timer sends an event to the currently-executing domain. */
static struct ac_timer t_timer[NR_CPUS];
- /*
- * Per-CPU timer which ensures that even guests with very long quantums get
- * their time-of-day state updated often enough to avoid wrapping.
- */
- static struct ac_timer fallback_timer[NR_CPUS];
-
extern xmem_cache_t *domain_struct_cachep;
+extern xmem_cache_t *exec_domain_struct_cachep;
void free_domain_struct(struct domain *d)
{
/* Periodic tick timer: send timer event to current domain*/
static void t_timer_fn(unsigned long unused)
{
- struct exec_domain *p = current;
- struct domain *d = current;
++ struct exec_domain *ed = current;
++ struct domain *d = ed->domain;
TRACE_0D(TRC_SCHED_T_TIMER_FN);
- if ( !is_idle_task(p->domain) ) {
- update_dom_time(p->domain);
- send_guest_virq(p, VIRQ_TIMER);
+ if ( !is_idle_task(d) )
+ {
- update_dom_time(d->shared_info);
- send_guest_virq(d, VIRQ_TIMER);
++ update_dom_time(d);
++ send_guest_virq(ed, VIRQ_TIMER);
}
- t_timer[p->processor].expires = NOW() + MILLISECS(10);
- add_ac_timer(&t_timer[p->processor]);
+ t_timer[d->processor].expires = NOW() + MILLISECS(10);
+ add_ac_timer(&t_timer[d->processor]);
}
/* Domain timer function, sends a virtual timer interrupt to domain */
static void dom_timer_fn(unsigned long data)
{
- struct domain *d = (struct domain *)data;
+ struct exec_domain *ed = (struct exec_domain *)data;
- struct domain *d = ed->domain;
++
TRACE_0D(TRC_SCHED_DOM_TIMER_FN);
- update_dom_time(d);
- update_dom_time(d->shared_info);
- send_guest_virq(d, VIRQ_TIMER);
++ update_dom_time(ed->domain);
+ send_guest_virq(ed, VIRQ_TIMER);
}
-
- /* Fallback timer to ensure guests get time updated 'often enough'. */
- static void fallback_timer_fn(unsigned long unused)
- {
- struct exec_domain *ed = current;
- struct domain *p = ed->domain;
-
- TRACE_0D(TRC_SCHED_FALLBACK_TIMER_FN);
-
- if ( !is_idle_task(p) )
- update_dom_time(p);
-
- fallback_timer[ed->processor].expires = NOW() + MILLISECS(500);
- add_ac_timer(&fallback_timer[ed->processor]);
- }
-
/* Initialise the data structures. */
void __init scheduler_init(void)
{
t_timer[i].cpu = i;
t_timer[i].data = 3;
t_timer[i].function = &t_timer_fn;
-
- init_ac_timer(&fallback_timer[i]);
- fallback_timer[i].cpu = i;
- fallback_timer[i].data = 4;
- fallback_timer[i].function = &fallback_timer_fn;
}
- schedule_data[0].idle = &idle0_task;
+ schedule_data[0].idle = &idle0_exec_domain;
extern char opt_sched[];